package com.haiyi.software.ui.controller;

import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

import com.haiyi.software.app.R;

public class WatingProgressDialog extends Dialog {

	Context context;

	public WatingProgressDialog(Context context) {
		super(context);
		// TODO 自动生成的构造函数存根
		this.context = context;
	}

	public WatingProgressDialog(Context context, int theme) {
		super(context, theme);
		this.context = context;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO 自动生成的构造函数存根
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.wating_progress_dialog);

		// main.xml中的ImageView
		ImageView spaceshipImage = (ImageView) this
				.findViewById(R.id.dialog_title_image);

		spaceshipImage.setBackgroundResource(R.drawable.animation_run_list);

		AnimationDrawable drawable = (AnimationDrawable) spaceshipImage
				.getBackground();

		drawable.start();

		// TextView tipTextView = (TextView)
		// this.findViewById(R.id.dialog_title);// 提示文字
		// 加载动画
		// Animation hyperspaceJumpAnimation = AnimationUtils.loadAnimation(
		// context, R.anim.animation_run_list);
		// 使用ImageView显示动画

		// spaceshipImage.startAnimation(hyperspaceJumpAnimation);
		setCanceledOnTouchOutside(false);
	}
}
